package intermediate_representation;

import java.util.ArrayList;

public class PrintRP extends InterRP {
    private ArrayList<String> paras;
    private String formatstring;

    public PrintRP(String formatstring) {
        this.formatstring = formatstring;
        this.paras = new ArrayList<>();
    }

    public ArrayList<String> getParas() {
        return paras;
    }

    public void addPara(String para) {
        this.paras.add(para);
    }

    public String getFormatstring() {
        return formatstring;
    }

    public String toString() {
        String str = "";
        for (String para: paras) {
            str += "push " + para + "\n";
        }
        str += "print " + formatstring;
        return str;
    }
}
